from pathos.multiprocessing import ProcessingPool as Pool 


from typing import Callable


def multiprocess(datas_list: list[list], 
                 task: Callable,
                 num_processes: int):
    
    with Pool(num_processes) as pool:
        all_results = pool.map(task, *datas_list)
    return all_results